﻿<BaseClass:ListControlBase x:Name="listControlBase"
             x:Class="Rio.Framework.Pages.Controls.ListFolderControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     xmlns:BaseClass="clr-namespace:Rio.Framework.Pages.Controls.BaseClass"
                           xmlns:Controls="clr-namespace:Rio.Framework.Pages.Controls" mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">

    <BaseClass:ListControlBase.Resources>
        <Style x:Key="GridViewRowStyle"
               TargetType="telerik:GridViewRow">
            <Setter Property="IsTabStop"
                    Value="False" />
            <Setter Property="Background"
                    Value="{StaticResource GridViewRowNormalBackground}" />
            <Setter Property="BorderBrush"
                    Value="{StaticResource GridLinesFill}" />
            <Setter Property="Foreground"
                    Value="{StaticResource GridViewForeground}" />
        </Style>
        <Style x:Key="GridViewAlternateRowStyle"
               TargetType="telerik:GridViewRow">
            <Setter Property="Background"
                    Value="#FFEDECD8" />
        </Style>

        <DataTemplate x:Key="RowDetailsFolderTemplate">
            <Controls:ListDocumentControl Loaded="ListDocumentControlLoaded" />
        </DataTemplate>

    </BaseClass:ListControlBase.Resources>

    <Grid HorizontalAlignment="Stretch"
          VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <telerik:RadToolBar Grid.Column="0"
                                      Grid.ColumnSpan="2"
                                      Grid.Row="0"
                                      x:Name="RadMenu"
                                      VerticalAlignment="Top"
                                      Background="#00C8C5C5"
                                      Visibility="Visible"
                                      IsOverflowOpen="False"
                                      BorderThickness="1">
            <telerik:RadMenuItem Name="buttonDisplay"
                                           IsEnabled="False"
                                           Header="Afficher"
                                           Click="ButtonDisplayClick">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/display.png"
                           Width="20" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonDelete"
                                           IsEnabled="False"
                                           Header="Supprimer"
                                           Click="ButtonDeleteClick">
                        <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Trash.png"
                           Width="20" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonExport"
                                           IsEnabled="False"
                                           Header="Exporter"
                                           Click="ButtonExportClick">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Excel16.png"
                           Width="20" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonAlert"
                                           IsEnabled="False"
                                           Header="Alerter"
                                           Click="ButtonAlertClick">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Alert.png"
                           Width="20" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonDownload"
                                           IsEnabled="False"
                                           Header="Télécharger"
                                           Click="ButtonDownloadClick">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/download.png"
                           Width="20" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
        </telerik:RadToolBar>
        <TextBlock Grid.Row="0"
                   Name="LabelNbrOfFolderResults"
                   HorizontalAlignment="Right"
                   Margin="0,0,15,-8"
                   VerticalAlignment="Bottom"
                   Visibility="Collapsed"
                   Height="30" />

        <telerik:RadGridView CanUserDeleteRows="True"
                          x:Name="GridViewDoc"
                          Grid.Row="1"
                          SelectionMode="Extended"
                          SelectionChanged="GridViewDocSelectionChanged"
                          AutoGenerateColumns="False"
                          RowDetailsVisibilityChanged="GridViewDocRowDetailsVisibilityChanged"
                          Language="fr"
                          ShowGroupPanel="True"
                          AlternationCount="2"
                          AlternateRowStyle="{StaticResource GridViewAlternateRowStyle}"
                          GridLinesVisibility="Horizontal"
                          Deleting="GridViewDocDeleting"
                          IsFilteringAllowed="True"
                          RowHeight="32"
                          Margin="0"
                          ItemsSource="{Binding Folders, ElementName=listControlBase, Mode=TwoWay}">

            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu ItemClick="RadContextMenuItemClick"
                                                  Opened="RadContextMenuOpened">
                    <telerik:RadMenuItem Name="DeleteItemContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Trash16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Name="ExportExcelContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Excel16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <!--<telerikNavigation:RadMenuItem Name="CreateReportContextMenu">
                        <telerikNavigation:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/CreateReport16.png" />
                        </telerikNavigation:RadMenuItem.Icon>
                    </telerikNavigation:RadMenuItem>-->
                    <telerik:RadMenuItem Name="Separator1ContextMenu"
                                                   IsSeparator="True" />
                    <telerik:RadMenuItem Name="OpenFolderContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/FolderSearch16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="AddDocumentContextMenu"
                                                   Header="">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Add_Document16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="DisplayFolderNoteContextMenu"
                                                   Header="">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/FolderNote16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="Separator2ContextMenu"
                                                   IsSeparator="True" />
                    <telerik:RadMenuItem Name="PrintMenuContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Viewer/Printer16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="DownloadFolderContextMenu"
                                                   Header="Télécharger">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/download.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="Separator3ContextMenu"
                                                   IsSeparator="True" />
                    <telerik:RadMenuItem Name="PasteMenuContextMenu"
                                                   IsEnabled="{Binding isPastEnabled, Mode=OneWay}">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Viewer/Paste16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

        </telerik:RadGridView>


        <telerik:RadDataPager x:Name="DataPagerDoc"
                                Grid.Row="2"
                                DisplayMode="FirstLastPreviousNextNumeric"
                                IsTotalItemCountFixed="True"
                                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                PageSize="100"
                                NumericButtonCount="10"
                                Source="{Binding ListDocument}" />
    </Grid>
</BaseClass:ListControlBase>
